import { Column, Entity } from "typeorm";

import { Journal, JournalGateway, ENUM_APP } from "qqlx-core";
import { TransformerEnum } from "@lib/orm.transfor.enum";
import { TransformerBoolean } from "@lib/orm.transfor.boolean";

import { IntroBigIdTradableSchema } from "@/alpha/ext.big-id.tradable-intro";

@Entity({ name: JournalGateway.relations })
export class JournalSchema extends IntroBigIdTradableSchema implements Journal {
  @Column({ transformer: new TransformerEnum(Object.values(ENUM_APP), ENUM_APP.NONE) })
  app: ENUM_APP = ENUM_APP.NONE;

  @Column({ transformer: new TransformerBoolean() })
  isManual: boolean = false;
}
